part of 'card_info.dart';

class TranslationSelectionCardInfo extends Equatable implements CardInfo {
  TranslationSelectionCardInfo({
    String? cardId,
    required this.lexicalItem,
    required this.safeToPronounce,
    required this.answerOptionLexicalItems,
  }) : cardId = cardId ?? UuidGenerator().generateUuid();

  @override
  final String cardId;

  final LexicalItem lexicalItem;
  final bool safeToPronounce;
  final BuiltList<LexicalItem> answerOptionLexicalItems;

  @override
  List<Object?> get props {
    return [
      cardId,
      lexicalItem,
      safeToPronounce,
      answerOptionLexicalItems,
    ];
  }

  TranslationSelectionCardInfo copyWith({
    LexicalItem Function()? lexicalItem,
    bool Function()? safeToPronounce,
    BuiltList<LexicalItem> Function()? answerOptionLexicalItems,
  }) {
    return TranslationSelectionCardInfo(
      cardId: cardId,
      lexicalItem: lexicalItem == null ? this.lexicalItem : lexicalItem(),
      safeToPronounce: safeToPronounce == null ? this.safeToPronounce : safeToPronounce(),
      answerOptionLexicalItems: answerOptionLexicalItems == null
          ? this.answerOptionLexicalItems
          : answerOptionLexicalItems(),
    );
  }
}
